package com.internship.service;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.internship.dao.DepartmentInfoDao;
import com.internship.model.DepartmentInfo;
import com.internship.page.Page;

@Service
public class DepartmentInfoService {
	private final int PAGE_SIZE = 10;
	@Autowired
	private DepartmentInfoDao departmentInfoDao;
	public DepartmentInfo getDepartmentInfo(String XYMC) {
		return departmentInfoDao.getDepartmentInfo(XYMC);
	}
	public DepartmentInfo getDepartmentInfoByXYDM(String XYDM) {
		return departmentInfoDao.getDepartmentInfoByXYDM(XYDM);
	}
	public Page<DepartmentInfo> getDepartmentInfoList(String XYMC,int pageNumber) {
		Page<DepartmentInfo> page = new Page<DepartmentInfo>(pageNumber, PAGE_SIZE);
		List<DepartmentInfo> list = departmentInfoDao.getDepartmentInfoList(XYMC, page);
		page.setResultList(list);
		return page;
	}
	public List<DepartmentInfo> getDepartmentInfoList() {
		List<DepartmentInfo> list = departmentInfoDao.getDepartmentInfoList();
		return list;
	}
	public int addDepartmentInfo(DepartmentInfo departmentInfo) {
		return departmentInfoDao.addDepartmentInfo(departmentInfo);
	}
	public int updateBjdmb(DepartmentInfo departmentInfo) {
		return departmentInfoDao.updateDepartmentInfo(departmentInfo);
	}
	public int delDepartmentInfo(String XYDM) {
		return departmentInfoDao.delDepartmentInfo(XYDM);
	}
	public int delAll(String[] ids) {
		return departmentInfoDao.delAll(ids);
	}

}
